﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using ThanNhanTao.Server.Entities;

namespace ThanNhanTao.Server.BLL
{
    public class Dm_BenhVienBLL
    {
        bvdn_thannhantaoEntities entities;
        public Dm_BenhVienBLL()
        {
            entities = ThanNhanTaoGlobalServer.bvdn_thannhantaoEntities;
        }

        public Dm_BenhVien RetrieveBenhVienByMaBV(string maBV)
        {
            Dm_BenhVien results = (from bv in entities.Dm_BenhVien
                                   where bv.MaBV == maBV
                                   select bv).FirstOrDefault();
            return results;
        }

        public List<BenhVienCustomEntities> RetrieveAllBenhVienCustomEntities()
        {
            List<BenhVienCustomEntities> results = (from bv in entities.Dm_BenhVien
                                                    select new BenhVienCustomEntities
                                                    {
                                                        MaBV = bv.MaBV,
                                                        TenBV = bv.TenBV
                                                    }).ToList();
            return results;
        }
    }
}
